package studio.raptor.hub.in.config;

import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by liuyong8 on 2017/9/21.
 */
@Configuration
public class DataSourceConfig {
  @Bean(name = "hubInDataSource")
  @ConfigurationProperties(prefix = "hubin.datasource")
  public DataSource usbDataSource() {
    return DataSourceBuilder.create().type(HikariDataSource.class).build();
  }
}
